/**
 * Author: 老洋
 * Date:  2021/3/28 16:00
 */
package com.yyy.dao;


import com.yyy.pojo.Department;
import org.springframework.stereotype.Repository;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

@Repository
public class DepartmentDao {
    public static Map<Integer, Department> departments = null;

    static{
        //模拟数据
        departments = new HashMap<Integer, Department>();
        departments.put(101, new Department(101, "教学部"));
        departments.put(102, new Department(102, "学工部"));
        departments.put(103, new Department(103, "教务处"));
        departments.put(104, new Department(104, "财务部"));
        departments.put(105, new Department(105, "人事部"));
    }

    public Collection<Department> getAllDepartmentsInfo(){
        return departments.values();
    }

    public Department getDepartmentById(Integer id){
        return departments.get(id);
    }
}